from fastapi import FastAPI, APIRouter
from fastapi.staticfiles import StaticFiles
from pydantic_notes.views import emp_notes

app = FastAPI()
# 项目下的static目录
app.mount("/static", StaticFiles(directory="static"), name="static")
# 加载分路由
app.include_router(emp_notes)


@app.get("/")
async def root():
    return {"message": "Hello World"}


@app.get("/hello/{name}", tags=["用户招呼组"],
         description="Hello World",
         response_description='对输入的用户打招呼')
async def say_hello(name: str):
    return {"message": f"Hello {name}"}


if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app)
